import type { RoleType } from "../role/types";
import type { BaseResponseData } from '@/api/common/CommonResponse'
import type { BasePageRequest } from '@/api/common/CommonRequest'

// 用户登录请求参数
export interface UserLoginRequest {
  username: string;
  password: string;
}

// 用户登录返回值
export interface UserLoginReponse extends BaseResponseData {
  data: {
    tokenName: string
    tokenValue: string
  }
}

// 用户基本类型
export interface UserType {
  id?: number;
  username?: string;
  password?: string;
  nickname?: string;
  avatar?: string;
  roles?: RoleType[];
  buttons?: string[];
  routes?: string[];
  token?: string;
}

// 根据id获取用户信息返回值
export interface UserResponse extends BaseResponseData {
  data: UserType;
}

// 分页查询用户的参数
export interface UserPageRequest extends BasePageRequest {
  nickname?: string;
}

// 给用户分配角色的参数
export interface UserAllocRoleRequest {
  id: number;
  roles: RoleType[];
}
